package io;

import java.io.File;
import java.io.IOException;

public class Demo1 {
    public static void main(String[] args) throws IOException {
//        File f = new File("d:/text.txt");
        File f = new File("./text.txt");
        System.out.println(f.getParent());//返回File对象的父目录文件路径
        System.out.println(f.getName());//返回File对象的文件名称
        System.out.println(f.getPath());//返回File对象的文件路径
        System.out.println(f.getAbsolutePath());//返回File对象的绝对路径
        System.out.println(f.getCanonicalPath());//返回File对象修饰过的绝对路径
    }
}
